﻿@model IEnumerable<HRM.DAL.DAO.Contact>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p  id="index-addlink">
    @Html.ActionLink("Add Contact", "Create")
</p>
<table class="view"> 
    <tr>
        <th>
            Employee
        </th>
        <th>
            FirstContact
        </th>
        <th>
            Secondcontact
        </th>
        <th>
            EmergencyContactPerson
        </th>
        <th>
            EmergencyContactNumber
        </th>
        <th>
            PresentAddress
        </th>
        <th>
            PermanentAddress
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Employee.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.FirstContact)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Secondcontact)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.EmergencyContactPerson)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.EmergencyContactNumber)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PresentAddress)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PermanentAddress)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
            @Html.ActionLink("Details", "Details", new { id=item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.Id })
        </td>
    </tr>
}

</table>
